<html>
<head>
	<meta content="IE=10" http-equiv="X-UA-Compatible" />
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title></title>
    <link href="officecontrol/ntkoStyle.css" rel="stylesheet" type="text/css" />
  <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="officecontrol/ntkobackground.min2.js"></script>
    <script type="text/javascript" src="officecontrol/ntko.js"></script>
  <style>
    .yongyin {
      width:100px;
      text-align:center;
      line-height:100%;
      padding:0.3em;
      font:16px Arial,sans-serif bold;
      font-style:normal;
      text-decoration:none;
      vertical-align:text-bottom;
      zoom:1;
      outline:none;
      font-size-adjust:none;
      font-stretch:normal;
      border-radius:50px;
      box-shadow:0px 1px 2px rgba(0,0,0,0.2);
      text-shadow:0px 1px 1px rgba(0,0,0,0.3);
      color:#2c3e50;
      border:0.2px solid #2299ff;
      background-repeat:repeat;
      background-size:auto;
      background-origin:padding-box;
      background-clip:padding-box;
      background-color:#3399ff;
      background: linear-gradient(to bottom, #eeeff9 0%,#3399ff 100%);
    }
    .yongyin:hover {
      background: #268DFF;
    }
  </style>
	<script type="text/javascript">
	var cmd;	//命令类型
	var datatext;
	var datavalue;
	function getQueryString() {
		var url = window.location.href;
		var str = url.split('?');
		var str2 = str[1].split('&');
    return str2[0];
	}

	function CurentTime()
	{
		var now = new Date();

		var year = now.getFullYear();       //年
		var month = now.getMonth() + 1;     //月
		var day = now.getDate();            //日

		var hh = now.getHours();            //时
		var mm = now.getMinutes();          //分
		var ss = now.getSeconds();          //分

		var clock = year + "-";

		if(month < 10)
			clock += "0";

		clock += month + "-";

		if(day < 10)
			clock += "0";

		clock += day + " ";

		if(hh < 10)
			clock += "0";

		clock += hh + ":";
		if (mm < 10) clock += '0';
		clock += mm + ":";
		if (ss < 10) clock += '0';
		clock += ss;
		return(clock);
	}

	//在子页面定义的向父页面回传值的方法，方法名可以自定义
	function ntkoSendDataToParentPage()
	{
		var varData = new Array();
		varData.push(ntko.docsize);
		varData.push(CurentTime());
		ntkoBrowser.ntkoSetReturnValueToParentPage("OnData",varData);

	}
	function ntkoDataToChild(data){
	ntko.SetBookmarkValue("ntko",data);
	var ntkoc= ntko.ActiveDocument.bookMarks.count;
	 for(var i=1;i<=ntkoc;i++){
	  var ntkoname= ntko.ActiveDocument.bookMarks.item(i).name;
	  if(ntkoname=="ntko"){
	  ntko.ActiveDocument.bookMarks.item(i).select();
	  ntko.ActiveDocument.Application.Selection.Font.Color=255;
	  ntko.ActiveDocument.Application.Selection.Font.Bold=9999998;
	  ntko.ActiveDocument.Application.Selection.Font.Size = 16;
	  }
	 }
	}
	function ntkoGetParentData(data){//该方法用于接收父页面传递的值
	datatext=data;
	}
   function ntkocloseparentpage(){
   	if(cmd==4){
	ntkoSendDataToParentPage();
	}
   }
	</script>


</head>



<body onload="cmd=getQueryString();init(cmd);" onbeforeunload="ntkocloseparentpage()">
<script >
 if(cmd==5){
     ntko.ShowTipMessage("注意","已经接收到父页面传过来的值,请注意文档中内容的变化");
     ntkoDataToChild(datatext);
 }
</script>
<div style="height:10%;text-align: center" id="btn">
  <button type="button" class="yongyin" onclick="saveFiles()" style="width:130px; height:50px;" >保存文档</button>
</div>

	<div class="divBody" style="width:100%;">
		<script type="text/javascript" src="officecontrol/ntkoofficecontrol.min.js"></script>
	</div>
</body>
</html>
